package reflect;

import lombok.Data;
import org.junit.Test;

/**
 * @author zuolonglong
 * @version 1.0
 * @description
 * @date 2022/9/19
 */
public class CreateObjectTest {

    @Test
    public void createObjectTest() throws InstantiationException, IllegalAccessException {
        Class<Person> personClass = Person.class;
        Person person = personClass.newInstance();
    }

}

@Data
class Person{
    private String name;
    private int age;

    public Person(){
        System.out.println("无参构造方法执行");
    }
}
